package com.leejxx.health.mobile.controller;

import com.leejxx.health.common.MessageConst;
import com.leejxx.health.entity.Result;
import com.leejxx.health.service.SmsService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author LeeJx
 * @ClassName ValidateCodeController
 * @Description TODO
 * @date 2021/1/6 10:30
 * @Version 1.0
 */
@RestController
@Slf4j
@RequestMapping("/mobile/validateCode")
public class ValidateCodeController {
    @DubboReference
    private SmsService smsService;

    @RequestMapping("/send")
    public Result send(String type, String telephone) {
        log.info("[验证码-发送type:{},telephone:{}]", type, telephone);
        smsService.sendValidateCode(type, telephone);
        return new Result(true, MessageConst.SEND_VALIDATECODE_SUCCESS);
    }
}
